package com.hugh.glrpcconsumer.controller;

import com.alibaba.fastjson.JSON;
import com.hugh.glrpcconsumer.service.ApiUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: Hugh
 * @Date: 2020/6/14
 */
@Controller
@RequestMapping(value = "api/")
@Slf4j
public class UserController {

    @Autowired
    private ApiUserService userService;

    @RequestMapping(value = "user")
    @ResponseBody
    public Object getUser(){
        Object userInfo = userService.getUserInfo();
        log.info("UserController:{}", JSON.toJSON(userInfo));
        return userInfo;
    }

    @RequestMapping(value = "resume")
    @ResponseBody
    public Object resume(){
        Object userInfo = userService.queryResumeList();
        log.info("UserController:{}", JSON.toJSON(userInfo));
        return userInfo;
    }
}
